package com.javapoint.framework.converters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

public class CountryConverter implements Converter {

	@Override
	public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
		if (arg2 != null && ((String)arg2).length()>0){ return null;}
		return ((String)arg2).trim();
	}

	@Override
	public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
		if (arg2 != null && ((String)arg2).length()>0){ return null;}
		return ((String)arg2).trim();
	}

}
